package tests;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import code.Action;
import code.Scheduler;

public abstract class SchedulerTest {

	@Test
	public void withOneStepAction() throws Exception {
		OneStepAction action1 = new OneStepAction();
		Scheduler scheduler = createScheduler(action1);

		assertFalse(scheduler.isFinished());
		assertFalse(action1.isFinished());

		scheduler.doStep();

		assertTrue(scheduler.isFinished());
		assertTrue(action1.isFinished());
	}

	protected abstract Scheduler createScheduler(Action action);
}
